#define _CRT_SECURE_NO_WARNINGS
#include<algorithm>
#include"vector.h"

namespace my_vector
{
	void test1()
	{
		vector<int> v1;
		v1.reserve(4);
		v1.push_back(1);
		v1.push_back(2);
		v1.push_back(3);
		v1.push_back(4);
		v1.insert(v1.begin() + 1, 10);

		print_vector(v1);
	}

	void test2()
	{
		vector<int> v1;
		v1.push_back(1);
		v1.push_back(2);
		v1.push_back(3);
		v1.push_back(4);
		/*v1.push_back(5);
		v1.push_back(6);*/

		int x = 2;
		auto p = std::find(v1.begin(), v1.end(), x);
		if (p != v1.end())
		{
			 p = v1.insert(p, 100);
			 *(p + 1) *= 10;			
		}
		//v1.insert(v1.begin(), 100);

		print_container(v1);
	}

	void test3()
	{
		vector<int> v1;
		v1.push_back(1);
		v1.push_back(2);
		v1.push_back(3);
		v1.push_back(4);
		v1.push_back(5);
		v1.push_back(6);

		v1.erase(v1.begin());
		
		v1.resize(3);
		v1.push_back(6);

		print_container(v1);
	}

	void test4()
	{
		int i = int();
		int j(1);
		
		cout << i << endl;
		cout << j << endl;
		cout << int(2) << endl;
	}

	void test5()
	{
		vector<int> v1;
		v1.push_back(1);
		v1.push_back(2);
		v1.push_back(3);
		v1.push_back(4);
		v1.push_back(5);
		v1.push_back(6);

		v1.erase(v1.begin());

		v1.resize(3);
		v1.push_back(6);
		print_container(v1);

		//vector<int> v2 = v1;
		//print_container(v1);
		//print_container(v2);

		vector<int> v3(10, 5);
		print_container(v3);

		v1 = v3;
		print_container(v1);
	}
	//void test6()
	//{
	//	vector<int> v1;
	//	v1.push_back(1);
	//	v1.push_back(2);
	//	v1.push_back(3);
	//	v1.push_back(4);
	//	v1.push_back(5);
	//	v1.push_back(6);

	//	vector<int> v2(v1.begin() + 1, v1.begin() + 3);

	//	print_container(v1);
	//	print_container(v2);
	//}

	void test7()
	{
		vector<string> v1;

		v1.push_back("11111");
		v1.push_back("11111");
		v1.push_back("11111");
		v1.push_back("11111");
		print_container(v1);

		v1.push_back("11111");
		print_container(v1);
	}
	
}

int main()
{
	my_vector::test7();
	return 0;
}